package com.psdi.util;

public class Debug {
    private static volatile int count = 0;
    private static volatile String latestMessage = "";
    private static final Object lock = new Object(); // 用于线程同步

    public static void log(String message) {
        synchronized (lock) {
            if (!message.equals(latestMessage)) {
                count = 1;
                latestMessage = message;
                System.out.printf("Debug Log [%d]: %s%n", count, message);
            }
        }
    }
}
